package com.pro.grpcserver;


import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;


public class GrocServiceClientTwoSingleton  {

        public  static String consulIP;


        public static String getConsulIP() {
                if(StringUtils.isEmpty(consulIP)){
                        PropertiesUtil.readProperties("application.properties");
                        consulIP = PropertiesUtil.getProperty("consul.ip");
                }
                return consulIP;
        }

        public static GrocServiceClientTwo grocServiceClientTwo=
                new GrocServiceClientTwo(GrocServiceClientTwoSingleton.getConsulIP());

        public  static  GrocServiceClientTwo getSignleton(){
                if(grocServiceClientTwo == null){
                        grocServiceClientTwo= new GrocServiceClientTwo(consulIP);
                }
                return grocServiceClientTwo;
        }
}